﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Infrastructure;

namespace Data
{
    public class BooksDAO
    {

        public IEnumerable<Book> GetAllBooksFromStorage()
        { 
            // example using a in-memory style

            var books = GetExampleCollectionOfBooks();

            return books;
        }

        private IEnumerable<Book> GetExampleCollectionOfBooks()
        {
            return new List<Book>
            {
                new Book 
                {  
                    Title = "My first book",
                    ID = 1,
                    Description = "This is my very first book about...",
                    ISBN = "0-9752298-0-X",
                    Published = new DateTime(2010, 01, 01),
                    Author = new Person
                    {
                        FirstName = "Johan",
                        LastName = "Leino"
                    }
                },
                new Book 
                {  
                    Title = "My second book",
                    ID = 2,
                    Description = "This is my second book about...",
                    ISBN = "0-943396-04-2",
                    Published = new DateTime(2010, 01, 12),
                    Author = new Person
                    {
                        FirstName = "Johan",
                        LastName = "Leino"
                    }
                },
                new Book 
                {  
                    Title = "My third book",
                    ID = 3,
                    Description = "This is my third book about...",
                    ISBN = "85-359-0277-5",
                    Published = new DateTime(2010, 01, 20),
                    Author = new Person
                    {
                        FirstName = "Johan",
                        LastName = "Leino"
                    }
                }

            };
        }
    }
}
